package com.zywl.web.controller.base;

import com.zywl.utils.utils.Constants;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

@RestController
@RequestMapping("/")
public class CommonController {
    @GetMapping("/{fileName}")
    public ModelAndView view(@PathVariable String fileName) {
        return new ModelAndView(fileName);
    }

    @GetMapping("/{filePath}/{fileName}")
    public ModelAndView viewPath(@PathVariable String filePath, @PathVariable String fileName) {
        return new ModelAndView(filePath + Constants.STRING_SPRIT + fileName);
    }
}
